﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Experiencia.ascx.cs"
    Inherits="RzCorportativo.Views.Experiencia" %>
<%@ Register TagPrefix="rz" TagName="Endereco" Src="~/Views/Endereco.ascx" %>
<div class="span15 well">
    <div class="controls controls-row">
        <label class="checkbox inline" style="width:100px">
            Emprego Atual   
            <asp:CheckBox Text="" runat="server" ID="EmpregoAtual" />
        </label>
    </div>
    <div class="controls controls-row">
        <asp:TextBox runat="server" ID="Empresa" placeholder="Empresa" data-toggle="tooltip"
            title="Empresa" Style="text-transform: uppercase" data-placement="left" />
        <asp:TextBox runat="server" ID="NomeCargoExperiencia" placeholder="Cargo" type="text"
            name="complete" value="" auto-complete="true" eid="descricaoCargoExperiencia"
            requesttype="post" contenttype="application/json; charset=utf-8" isasync="true"
            length="1" datatype="json" templeted="true" onrender="getItemCargoExperiencia"
            onerror="getErrorCargoExperiencia" onselected="selectedItemCargoExperiencia"
            data-toggle="tooltip" title="Cargo" data-placement="left" />
        <asp:HiddenField runat="server" ID="ExperienciaId" />
        <asp:HiddenField runat="server" ID="CargoExperienciaId" />
    </div>
    <div class="controls controls-row">
        <asp:TextBox runat="server" ID="NomeContatoExperiencia" placeholder="Nome do contato"
            data-toggle="tooltip" title="Nome do contato" data-placement="left" />
        <asp:TextBox runat="server" ID="TelefoneContatoExperiencia" placeholder="Telefone contato"
            data-toggle="tooltip" title="Telefone contatoto" data-placement="left" mask="telefone" />
    </div>
    <div class="controls controls-row">
        <asp:TextBox runat="server" ID="DataInicio" placeholder="Data de Início" data-toggle="tooltip"
            title="Data de Início" data-placement="left" date="true" mask="calendar" />
        <asp:TextBox runat="server" ID="DataFim" placeholder="Data de Término" data-toggle="tooltip"
            title="Data de Término" data-placement="left" date="true" mask="calendar" />
    </div>    
    <div class="controls controls-row">
        <asp:TextBox ID="Atividades" runat="server" TextMode="MultiLine" data-toggle="tooltip"
            title="Ativdades desempenhadas" data-placement="left" placeholder="Ativdades desempenhadas"
            Width="550"></asp:TextBox>
    </div>
    <div class="controls controls-row">
        <asp:Button Text="adicionar" runat="server" CssClass="btn btn-success" ID="btnAdionaExperiencia" />
    </div>
</div>
<br />
<div dataspy="">
    <table class="table table-hover" id="gridExperiencia" runat="server">
        <thead>
            <tr>
                <th>
                    EMPRESA
                </th>
                <th>
                    CARGO
                </th>
                <th>
                    INÍCIO
                </th>
                <th>
                    TÉRMINO
                </th>
                <th>
                    #
                </th>
            </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
<script src="<%=this.ResolveUrl("~/Recursos/j/Experiencia.js")%>" type="text/javascript"></script>
<script type="text/javascript">
    function getItemCargoExperiencia(ul, item) {

        var inner_html = '<a><div class="list_item_container"><div class=""><strong>Cargo:</strong> ' +
                            item.Nome + '</div></div></a>';
        return $("<li style='width:350px'></li>")
            .data("item.autocomplete", item)
            .append(inner_html)
            .appendTo(ul);
    }

    function getErrorCargoExperiencia(e) {
        var _alert = new Alert();
        _alert.Name = "erroGeral";
        _alert.Type = AlertType.Error;
        _alert.AddMessage(e.d ? e.d : e.responseText);
        _alert.Show();
    }

    function selectedItemCargoExperiencia(event, ui, context) {
        var item = ui.item && ui.item.value ? ui.item : context;
        if (item.CargoId) {
            $("input[id$='CargoExperienciaId']").val(item.CargoId.toString(10))
        }
    }

</script>
